﻿@model CultuRAM.Models.RegisterModel
@{
    ViewBag.Title = "Alterar dados do Utilizador";
}

<h4>@ViewBag.Title</h4>

@using (Ajax.BeginForm("Edit",new { m = ViewBag.m }, new AjaxOptions
    {
        UpdateTargetId = "userManager",
        InsertionMode = InsertionMode.Replace,
        HttpMethod = "POST",
        OnSuccess = "UpdateListUsers()"
    })) 
{    
    
    @Html.AntiForgeryToken()
    @*@Html.ValidationSummary(false)*@
    @Html.HiddenFor(m => m.Email)

    <fieldset>
        <legend>Alteração dados do Utilizador</legend> 
           
        <div class="control-group">
            @Html.LabelFor(m => m.Email)         
            <div class="controls">    
                @Html.TextBoxFor(m => m.Email, new { @class="span12", @readonly = "readonly"})
            </diV>
        </div>
        <div class="control-group">
            @Html.LabelFor(m => m.UserName)         
            <div class="controls">    
                @Html.TextBoxFor(m => m.UserName, new { @class="span12"})
            </diV>
        </div>
        <div class="row">
            <div class="span6">
                <div class="control-group" style="padding-left: 30px;">
                    @Html.LabelFor(m => m.Password)       
                    <div class="controls">    
                        @Html.PasswordFor(m => m.Password, new { @class="span12"})
                    </diV>
                </div>
            </div>
            <div class="span6">
                <div class="control-group">
                    @Html.LabelFor(m => m.ConfirmPassword)      
                    <div class="controls">    
                        @Html.PasswordFor(m => m.ConfirmPassword, new { @class="span12"})
                    </diV>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="span6"> 
                <div class="control-group" style="padding-left: 30px;">
                    @Html.LabelFor(m => m.RoleName)     
                    <div class="controls">    
                        @Html.DropDownListFor(m => m.RoleName, Model.RolesList,"", new { @class="span12"}) 
                    </diV>
                </div>
            </div>
            <div class="span6"> 
                <div class="control-group">
                    @Html.LabelFor(m => m.EntityId)     
                    <div class="controls">    
                        @Html.DropDownListFor(m => m.EntityId, Model.EntitiesList,"", new { @class="span12"}) 
                    </diV>
                </div>
            </div>
        </div>

        <br/>
      
        <button class="btn btn-primary" value="Guardar" type="submit"><i class="icon-ok icon-white"></i> Guardar</button>
        @Html.Raw(@Ajax.ActionLink("replacetxt", "_Default", "Account",
                                   new AjaxOptions
                                       {
                                           UpdateTargetId="userManager", 
                                           InsertionMode = InsertionMode.Replace, 
                                           HttpMethod = "GET",
                                           OnComplete = "UserBgColorClear()" 
                                       }, new { @class = "btn btn-default btn-xs"}) 
                       .ToHtmlString().Replace("replacetxt", "<i class=\"icon-ban-circle\"></i> Cancelar"))  
       
    </fieldset>
    
}


@*@Scripts.Render("~/bundles/jqueryval")*@
@Scripts.Render("~/bundles/culturam")

